package com.itheima.tlias08_14.paramobject;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class InsertEmp {

    private Integer id;
    @NotNull(message = "用户名不能为空")
    @Length(min = 2, max = 20, message = "用户名长度必须在2-10之间")
    private String username; // 用户名
    @NotNull(message = "用户名不能为空")
    @Length(min = 2, max = 10, message = "用户名长度必须在2-10之间")
    private String name; // 姓名
    @Length(min = 11, max = 11, message = "手机号必须为11位")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;
    @Range(min = 1, max = 2, message = "性别必须为1或2")
    private int gender; // 性别, 说明: 1 男, 2 女
    private String image; // 头像
    private Integer deptId; // 部门ID
    private String entryDate; // 入职时间
    @Range(min = 1, max = 5, message = "职位必须为1-5")
    private Integer job; // 职位, 说明: 1 班主任,2 讲师, 3 学工主管, 4 教研主管, 5 咨询师
    private int salary; // 薪资
    private List<ExprPO> exprList;
}
